<?php

namespace YouBaoLian\Application\Response;

use YouBaoLian\Http\Response;

class VehicleSubmitUnderWriteResponse extends Response
{

    private $insuredId = 0;

    private $biSlipNo = '';

    private $ciSlipNo = '';

    private $checkState = 0;

    private $slipNo = '';

    private $policyNo = '';

    private $needCancelOrder = 0;

    private $insSpecialClause = [];

    public function build(): self
    {
        parent::build();


        $this->insuredId = $this->getBizContent('insuredId' ,0);
        $this->biSlipNo = $this->getBizContent('biSlipNo');
        $this->ciSlipNo = $this->getBizContent('ciSlipNo');
        $this->checkState = $this->getBizContent('checkState' ,0);
        $this->slipNo = $this->getBizContent('slipNo');
        $this->policyNo = $this->getBizContent('policyNo');
        $this->needCancelOrder = $this->getBizContent('needCancelOrder');
        $this->insSpecialClause = $this->getBizContent('insSpecialClause');

        $this->cheatState();

        return $this;

    }

    private function cheatState()
    {
        if ($this->checkState != 23) {
            $this->setError($this->message);
        }
    }

    /**
     * @return int
     */
    public function getInsuredId(): int
    {
        return $this->insuredId;
    }

    /**
     * @return string
     */
    public function getBiSlipNo(): string
    {
        return $this->biSlipNo;
    }

    /**
     * @return string
     */
    public function getCiSlipNo(): string
    {
        return $this->ciSlipNo;
    }

    /**
     * @return int
     */
    public function getCheckState(): int
    {
        return $this->checkState;
    }

    /**
     * @return string
     */
    public function getSlipNo(): string
    {
        return $this->slipNo;
    }

    /**
     * @return string
     */
    public function getPolicyNo(): string
    {
        return $this->policyNo;
    }

    /**
     * @return int
     */
    public function getNeedCancelOrder(): int
    {
        return $this->needCancelOrder;
    }

    /**
     * @return array
     */
    public function getInsSpecialClause(): array
    {
        return $this->insSpecialClause;
    }

}
